package com.elitel.frame.base.service;

import com.elitel.frame.main.entity.*;
import com.elitel.frame.main.entity.ext.Census;
import com.elitel.frame.main.entity.ext.DBServer;
import com.elitel.frame.main.entity.ext.QueryFiled;
import com.elitel.frame.main.entity.vo.PageResponseVo;
import com.elitel.frame.main.entity.vo.ServerTree;

import java.util.List;
import java.util.Map;

public interface DBServerService {

	public String insertServer(DBServer server);

	public String updateServer(DBServer server);

	public List<ServerTree> selectDbName();

	public List<DBServer> selectServer(String dbKey);

	public String deleteServer(String id);

	public PageResponseVo<DBServer> selectFenye(String dbKey, String pageNo, String pageSize);

	public DBServer selectServerOne(String guid);

	public Map<String, Object> selectTableName(String conn);

	public DBServer selectServerOnes(String conn);

	public Map<String, Object> selectTableMap(String conn);

	public PageResponseVo<BaseSqlconfig> selectServerShintColumn(String conn, String config);

	public String saveBaseSqlConfig(List<BaseSqlconfig> baseSqlconfig);

	public List<Census> selectField();

	public List<BaseSqlconfig> selectServerColumn(String serverid);

	public List<BaseSqlconfig> selectServerColumns(String serverid);

	public List<DBServer> selectALLsql();

	public List<CfgExtsql> getExtSqlList(String dbkey, String searchkey);

	public CfgDb getCfgDbOne(String dbkey);

	public String insertField(BaseQueryfield baseQueryfield);

	public List<BaseQueryfield> selectAllFiled(String serviceID);

	public String saveFiledConfig(List<BaseQueryfield> baseQueryfields);

	public String deleteFiled(String guid);

	public Map<String, String> selectAllTableMap(String conn);

	public List<QueryFiled> selectServerField(String guid);

	public BaseQuerysql selectQuerySql(String guid, int grade);

	public Integer insertSystem(SysPrjservice sysPrjservice);

	public void deleteexecuteSqlServerByPrjservice(SysPrjservice prjservice) throws Exception;
	/**
	 * 根据数据库的key值获取数据库的类型
	 *
	 * @param dbkey
	 * @return
	 */
	public String selectDbType(String dbkey);

	/**
	 * 解析 SQL 中的查询字段
	 *
	 * @param server
	 */
	public List<BaseQueryfield> parseSQLQueryField(DBServer server);
}
